package com.cq.hd.order.api.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.cq.hd.common.enums.biz.RewardTypeEnum;
import com.cq.hd.common.serialize.Decimal2Serializer;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class AppOrderPageVo implements Serializable {

    @ApiModelProperty(value = "id")
    private Long id;

    private Long businessId;

    private Long agentId;

    private Long agent2Id;

    @ApiModelProperty(value = "活动id")
    private Long activeId;

    @ApiModelProperty(value = "是否是零元购活动（1-不是，2-是）")
    private Integer zeroState;

    private Long userId;

    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @ApiModelProperty(value = "订单类型(1-团购订单,2-报名订单,4-团购+报名订单,5积分订单)")
    private Integer orderType;

    @ApiModelProperty(value = "活动标题")
    private String activeTitle;

    @ApiModelProperty(value = "活动图片")
    private String activeImg;

    @ApiModelProperty(value = "活动开始时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "活动结束时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "活动有效开始时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime validStartTime;

    @ApiModelProperty(value = "活动有效结束时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime validEndTime;

    @ApiModelProperty(value = "补贴类型(0-未设置,1-自动按比例分摊,2-手动设置)")
    private Integer subsidyState;

    @ApiModelProperty(value = "多件多折状态(1-关闭，2-开启)")
    private Integer discountState;

    @ApiModelProperty(value = "是否是阶梯价格(1-否，2-是)")
    private Integer stepPriceState;

    @ApiModelProperty(value = "分销开启状态(1-关闭，2-开启)")
    private Integer agentState;

    @ApiModelProperty(value = "核销方式(1-线上核销，2-线下核销)")
    private Integer verifyMethod;

    @ApiModelProperty(value = "未满员是否自动退款:1-是，2-否")
    private Integer noFullAutoRefundState;

    @ApiModelProperty(value = "活动总库存")
    private Integer totalStock;

    @ApiModelProperty(value = "订单状态(1-待支付,2-待核销,3-核销中,4-已取消,5-已完成,6-已关闭)")
    private Integer orderState;

    @ApiModelProperty(value = "下单数量")
    private Integer orderNum;


    @ApiModelProperty(value = "活动价格(如果是报名活动的阶梯价格，则是阶梯价格的最大价格)")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal activePrice;


    @ApiModelProperty(value = "订单总额")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal orderPrice;


    @ApiModelProperty(value = "实付金额")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal payPrice;


    @ApiModelProperty(value = "红包金额")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal redPacketAmt;


    @ApiModelProperty(value = "优惠金额")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal discountAmt;

    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal actualCommissionAmt;

    @ApiModelProperty(value = "其他权益")
    private String otherEquity;

    @ApiModelProperty(value = "计算佣金类型(0-无,1-固定佣金,2-专属佣金比例)")
    private Integer calCommissionType;

    @ApiModelProperty(value = "支付时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime payTime;

    @ApiModelProperty(value = "下单时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime orderTime;

    @ApiModelProperty(value = "订单取消时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime cancelTime;

    @ApiModelProperty(value = "订单取消原因")
    private String cancelReason;

    @ApiModelProperty(value = "订单完成时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime finishTime;

    @ApiModelProperty(value = "订单关闭时间")
    @JSONField(format="yyyy.MM.dd HH:mm:ss")
    private LocalDateTime closeTime;

    @ApiModelProperty(value = "订单备注")
    private String orderNote;

    private String hfReqDate;

    private String hfReqSeqId;

    @ApiModelProperty(value = "下单用户昵称")
    private String orderNickName;

    @ApiModelProperty(value = "下单用户头像")
    private String orderAvatar;

    @ApiModelProperty(value = "经纪人昵称")
    private String agentNickName;

    @ApiModelProperty(value = "经纪人头像")
    private String agentAvatar;

    @ApiModelProperty(value = "佣金")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal commissionAmt = BigDecimal.ZERO;

    @ApiModelProperty(value = "差x人满员/还差x人即可开启活动")
    private Integer missNum;

    @ApiModelProperty(value = "再邀x人(报名订单才有)")
    private Integer inviteNum;

    @ApiModelProperty(value = "可返x元(报名订单才有)")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal returnAmt;

    @ApiModelProperty(value = "未满员固定报名人数订单：差x人满员；阶梯人数：再邀x人，可返y元或者还差x人即可开启活动(报名订单才有)")
    private String inviteReturnMsg;

    @ApiModelProperty(value = "全单核销二级经纪人可得佣金")
    @JsonSerialize(using = Decimal2Serializer.class)
    private BigDecimal subAgentCommissionAmt;

    @ApiModelProperty(value = "一级经纪人可得积分")
    private BigDecimal agentPointsAmt;

    @ApiModelProperty(value = "二级经纪人可得积分")
    private BigDecimal subAgentPointsAmt;

    @ApiModelProperty(value = "GROUP_BUY(拼团)")
    private String promotionType;

    @ApiModelProperty(value = "订单对应活动的营销类型：GROUP_BUY(拼团)")
    private String activePromotionType;

    @ApiModelProperty(value = "拼团订单信息")
    private GroupBuyOrderDetailVo groupBuyOrderInfo;

    @ApiModelProperty(value = "推广奖励类型（0-无，1-佣金，2-其他权益，3-积分）")
    private Integer rewardType = RewardTypeEnum.NONE.getValue();

    @ApiModelProperty(value = "奖励积分")
    private BigDecimal rewardPoints;

}
